﻿using Singer.Middleware.AutoMapper;
using Singer.Middleware.FreeSql;
using Singer.Middleware.JwtAuth;
using Singer.Middleware.Redis;
using Singer.Framework;
using Singer.UnitTestWeb.Models;
using Singer.UnitTestWeb.Infrastructure.EFCore;
using Singer.Middleware.EFCore;
using Singer.Framework.SeedData;
using Singer.UnitTestWeb.Infrastructure.FreeSql;
using Singer.Framework.CoreDI;

namespace Singer.UnitTestWeb
{
    public static class DIExtensions
    {
        public static void AddAllServices(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddCores();
            services.AddFreeSql(configuration);
            services.AddJwtAuth(configuration);
            services.AddRedis(configuration);
            services.AddEFCore<TestEFCoreDbContext>(configuration);


            services.AddCoreMapper(typeof(TestMapperProfile));
            services.AddCoreDIServices(typeof(UserFreeSqlRepository).Assembly);
            services.AddDbSeedData<InitDbSeedData>();
        }
    }
}
